Repository navigation
Reject invalid custom page parameter types - #1665
michaelrsweet merged 1 commit into
Conversation
michaelrsweet
left a comment
There was a problem hiding this comment.
I think we can do without the unit test changes (this isn't a common issue and if the PPD loader rejects the file that is sufficient...)
WRT the custom parameter checks, we should also check that WidthOffset and HeightOffset are also points and that Orientation is PPD_CUSTOM_INT.
Custom PageSize processing consumes Width, Height, WidthOffset, and HeightOffset as point values and Orientation as an integer. Reject declarations with incompatible types before those values can be interpreted through the wrong union member. This prevents the disclosed Width string type confusion and applies the same invariant to the related custom page parameters. References: OSV-2026-551
3433193 to
46c5a98
Compare
|
Addressed in |
|
The requested simplification and full CustomPageSize type matrix are included in 46c5a98, and the focused ASan verification remains clean. When convenient, could you please take another look? |
Summary
ParamCustomPageSizeWidth, Height, WidthOffset, and HeightOffset declarations unless their type ispointsParamCustomPageSizeOrientation unless its type isintRoot cause
Custom PageSize processing consumes Width, Height, WidthOffset, and HeightOffset through the
custom_pointsunion member and Orientation throughcustom_int. A malformed PPD can declare one of those parameters with an incompatible pointer-backed type. For Width, the disclosed OSS-Fuzz testcase causesppdPageSize()to overwrite the pointer union member with float bits, andppdClose()later passes those bits tofree().Rejecting incompatible types during parsing prevents the union type confusion and applies the same invariant to the related custom page parameters.
Verification
Bad custom parameter, with no AddressSanitizer faultBad custom parameter, with no AddressSanitizer faultpointsparameters and integer Orientation was acceptedcups/testppdfocused suite: all checks passed under AddressSanitizergit diff --checkReferences: OSV-2026-551 / OSS-Fuzz issue 500762221